import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
// 客户端：发送数据。接收服务器反馈
public class TCP_Demo1_client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.191.1", 10000);

        OutputStream socketOutputStream = socket.getOutputStream();
        socketOutputStream.write("Hello,server , I`m the client ! ".getBytes());

        InputStream socketInputStream = socket.getInputStream();
        byte[] bys = new byte[1024];
        int len = socketInputStream.read(bys);
        System.out.println("The message from server is : \n " + new String(bys,0,len));

        socket.close();
    }
}
